package com.xt.base.util.json;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class JSONReflector {

	private JSONReflector(){}
	
	@SuppressWarnings("unchecked")
	public static Collection<Object> newCollection(Class<? extends Collection> clazz){
		if(clazz == null)return null;
		if(Set.class.equals(clazz) || Set.class.isAssignableFrom(clazz))return new HashSet<Object>();
		if(List.class.equals(clazz)|| List.class.isAssignableFrom(clazz))return new ArrayList<Object>();
		return null;
	}
	
}
